package cn.akwangl.design.pattern.behavioral.chainresponsibility.v2;

/**
 * 系主任
 *
 * @author youyongkun
 * @date 2021/12/7 10:40
 */
public class DepartmentHead extends Leader {
    @Override
    public void handleRequest(int leaveDays) {
        if (leaveDays <= 7) {
            System.out.println(String.format("系主任:请假%d天,获批.", leaveDays));
        } else {
            if (getNext() != null) {
                getNext().handleRequest(leaveDays);
            } else {
                System.out.println(String.format("请假%d天数过长,不予获批.", leaveDays));
            }
        }
    }
}
